using System.ComponentModel.DataAnnotations;

namespace AdminSystem.API.DTOs
{
    public class ModuleDto
    {
        public int Id { get; set; }
        public string Name { get; set; } = string.Empty;
        public string? Description { get; set; }
        public string? Icon { get; set; }
        public string? Route { get; set; }
        public int? ParentId { get; set; }
        public int SortOrder { get; set; }
        public bool IsActive { get; set; }
        public DateTime CreatedAt { get; set; }
        public List<ModuleDto> Children { get; set; } = new List<ModuleDto>();
    }

    public class CreateModuleDto
    {
        [Required]
        [StringLength(50)]
        public string Name { get; set; } = string.Empty;

        [StringLength(200)]
        public string? Description { get; set; }

        [StringLength(100)]
        public string? Icon { get; set; }

        [StringLength(200)]
        public string? Route { get; set; }

        public int? ParentId { get; set; }

        public int SortOrder { get; set; } = 0;
    }

    public class UpdateModuleDto
    {
        [Required]
        [StringLength(50)]
        public string Name { get; set; } = string.Empty;

        [StringLength(200)]
        public string? Description { get; set; }

        [StringLength(100)]
        public string? Icon { get; set; }

        [StringLength(200)]
        public string? Route { get; set; }

        public int? ParentId { get; set; }

        public int SortOrder { get; set; } = 0;

        public bool IsActive { get; set; }
    }
}
